/*
 * Copyright (C) 2009-2018 Hangzhou 2Dfire Technology Co., Ltd. All rights reserved
 */
package com.ws.soa.consumer.util;

/**
 * DateUtil
 *
 * @author luobosi@2dfire.com
 * @since 2019-01-28
 */
public class DateUtil {


    /**
     * 计算时间与当前时间相隔多少天
     *
     * @param date 要计算的时间戳
     * @return 天数
     */
    public static int calCurNumDays(Long date) {
        return (int)(System.currentTimeMillis() - date) / (60 * 60 * 24 * 1000);
    }

    public static void main(String[] args) {
        System.out.println(calCurNumDays(1548432000000L));
    }
}
